#ifndef USERDATAACCESS_H
#define USERDATAACCESS_H
#include <QString>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include "dal/persistence/DbConnector.h"
#include "dal/persistence/FileConnector.h"
#include "entity/UserInfo.h"
// 用户数据访问类
class UserDataAccess
{
public:
    static int userLoginPhone(const QString &phoneNumber, const QString &password);
    static int userRegisterPhone(const QString &phoneNumber, const QString &password);
    static int userLoginEmail(const QString &email, const QString &password);
    static int userRegisterEmail(const QString &email, const QString &password);

    static bool changePassword(const QString &userId, const QString &newPassword);
    static bool deleteAccount(const QString &userId);

    static UserInfo getUserInfo(const int &userId);
    static bool updateUserInfo(const int &userId, const QString &email, const QString &nickname, const QString &gender, const QString &signature);

    static bool addUserImage(const int &userId, const QByteArray &imageData);
    static QByteArray getUserImage(const int &userId);
};

#endif // USERDATAACCESS_H
